<include file="Public/head" />
<style type="text/css">
    .title-left a{color:#888;}
    .title-left .active{color:#009997;}
	.active{color:#3497db}
</style>
<div class="tableContainer">
	<div class="tablePanel">
		<div class="navInfo">
			<div class="title">
				<!-- 有title-icon1至title-icon14共14个图标可供选择 -->
				<span class="title-icon11"></span>
				<div>
				<a href="<{:U('Wechat/index_keyword',array('type'=>'1'))}>" class="<{:I('get.type')=='1'?'active':''}>" style="margin-left:10px;">文字</a>
        		&nbsp;&nbsp;|&nbsp;&nbsp;
				<a href="<{:U('Wechat/index_keyword',array('type'=>'2'))}>" class="<{:I('get.type')=='2'?'active':''}>">图文</a>
				</div>
			</div>
			<form method="get" action="<{:U('index_keyword')}>">
		        <input type="hidden" name="m" value="<{:MODULE_NAME}>" />
		        <input type="hidden" name="c" value="<{:CONTROLLER_NAME}>" />
		        <input type="hidden" name="a" value="<{:ACTION_NAME}>" />
		        <input type="hidden" name="type" value="<{:I('get.type')}>" />
		        <div class="searchWrapper">
		        <input name="keywords" class="searchItem" placeholder="请输入关键词" type="text" value="<{:I('get.keywords')}>"/>
		        <input value="搜索" class="button addBtn" type="submit" />
		        <input value="添加<{:I('get.type')=='1'?'文字':'图文'}>回复" class="button addBtn" type="button" onclick="location.href='<{:U('save_keyword',array('type'=>I('get.type')))}>'" />
		        </div>
		    </form>
		</div>
		<div class="tableContent">
			<div class="list0">
				<table cellspacing="0" cellpadding="0">
					<!-- 默认每列的宽度相等，如需调整某列宽度，只需加width属性 -->
					<thead>
						<tr class="thWrapper">
							<th class="titleFirst"></th><th>关键词</th>
							<if condition="$_GET['type'] eq '1'">
							<th class="sepTh"><div></div></th><th>内容</th>
							<else/>
							<th class="sepTh"><div></div></th><th>图片</th>
							<th class="sepTh"><div></div></th><th>标题</th>
							</if>
							<th class="sepTh"><div></div></th><th>推送量</th>
							<th class="sepTh"><div></div></th><th>状态</th>
							<th class="sepTh"><div></div></th><th>操作</th>
						</tr>
					</thead>
					<tbody>
						<foreach name="list" item="vo">
                            <tr class="tdWrapper">
								<td></td><td><{$vo.keyword}></td>
								<if condition="$_GET['type'] eq '1'">
								<td class="sepTd"></td><td><{$vo.content}></td>
								<else/>
								<td class="sepTd"></td><td><img src="<{$vo.pic}>" style="height:50px;margin-top:16px;"></td>
								<td class="sepTd"></td><td><{$vo.title}></td>
								</if>
								<td class="sepTd"></td><td><{$vo.push_num}></td>
								<td class="sepTd"></td>
								<if condition="$vo['state'] eq 1">
								<td style="color:#3497db;">开放中</td>
								<else/>
								<td style="color:#aaa">已关闭</td>
								</if>
								<td></td>
								<td>
									<a href="<{:U('save_keyword',array('id'=>$vo['id'],'type'=>I('get.type')))}>" title="修改">修改</a>
									&nbsp;|&nbsp;
									<a href="javascript:void(0);" onclick="delRow('<{$vo.id}>',this)" title="删除" id="delBtn<{$vo.id}>">删除</a>
								</td>
							</tr>
                        </foreach>
					</tbody>
				</table>
			</div>
			<!-- 分页 -->
			<div class="page-list">
				<div class="page-list"><{$page}></div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
function delRow(id,obj){
    if(confirm('确定要删除吗？')){
        $.get("<{:U('commonDel')}>",{id:id},function(res){
            if(res.status == 1){
                note_info(res.info,obj);
                setTimeout('location.reload()',1200);
            }else{
                note_info(res.info,obj,'warn');
            }
        },'json');
    }
}
</script>
<include file="Public/foot" />